import sys
import io
import time
from alg import Solution

# 设置中文输出环境
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')

if __name__ == "__main__":
    matrix = [
        ["1", "0", "1", "0", "0"],
        ["1", "0", "1", "1", "1"],
        ["1", "1", "1", "1", "1"],
        ["1", "0", "0", "1", "0"]
    ]

    print("测试矩阵为：")
    for row in matrix:
        print(' '.join(row))

    start = time.time()
    result = Solution().maximalSquare(matrix)
    end = time.time()

    print(f"\n最大正方形面积为：{result}")
    print(f"运行时间：{(end - start) * 1000:.3f} ms")
